import datetime as dt
from typing import TypeVar

from sqlalchemy.orm import Mapped, mapped_column, relationship

from recruit.adapter.database.models.base import AbstractResume

Resume = TypeVar('Resume')


class ResumeWork(AbstractResume):
    """ Model ResumeWork. """
    start_work: Mapped[int] = mapped_column(comment='Начало работы')
    end_work: Mapped[int] = mapped_column(comment='Окончание работы')
    position: Mapped[str] = mapped_column(comment='Позиция')
    company: Mapped[str] = mapped_column(comment='Компания')
    workplace: Mapped[str] = mapped_column(
        comment='Обязанности на рабочем месте'
    )
    resume: Mapped['Resume'] = relationship(
        back_populates='resume_work',
        lazy='selectin'
    )
